//WIP

class d_GearDialog {
	idd = -1;
	movingEnable = 1;
	onLoad = "uiNamespace setVariable ['X_GEAR_DIALOG', _this select 0];d_gear_dialog_open = true;call d_fnc_initgeardialog";
	onUnLoad = "uiNamespace setVariable ['X_GEAR_DIALOG', nil];d_gear_dialog_open = false;call d_fnc_closegeardialog";
	class controlsBackground {
		class BackGroundLeft: XC_RscText {
			colorBackground[] = {0, 0, 0, 0.7};
			x = 0.00127883 * safezoneWAbs + safezoneXAbs;
			y = SafeZoneY;
			w = 0.334668 * safezoneW;
			h = SafeZoneH;
		};
		class BackGroundRight: XC_RscText {
			colorBackground[] = {0, 0, 0, 0.7};
			x = 0.665929 * safezoneWAbs + safezoneXAbs;
			y = SafeZoneY;
			w = 0.334668 * safezoneWAbs;
			h = SafeZoneH;
		};
	};
	class controls {
		class CloseButton: XD_ButtonBase2 {
			text = "$STR_DOM_MISSIONSTRING_1218"; 
			action = "closeDialog 0";
			default = true;
			x = "SafeZoneX + SafeZoneW - 0.333";
			y = "SafeZoneY + SafeZoneH - 0.05";
		};
		
		class PrimaryButton: XD_ButtonBase2 {
			text = "Primary"; 
			action = ""; // TODO hide previous controlsgroup, show primary controls group
			x = 0.0078409 * safezoneW + safezoneX;
			y = "SafeZoneY + 0.01";
			w = 0.15;
		};
		class SecondaryButton: PrimaryButton {
			text = "Secondary"; 
			x = 0.106273 * safezoneW + safezoneX;
		};
		class HandgunButton: PrimaryButton {
			text = "Handgun"; 
			x = 0.2047051 * safezoneW + safezoneX;
		};
		
		class PrimaryControlsGroup: XD_RscControlsGroup {
			idc = 5000;
			x = -0.00528328 * safezoneW + safezoneX;
			y = 0.0519055 * safezoneH + safezoneY;
			w = 0.328106 * safezoneW;
			h = 0.938198 * safezoneH;
			class controls {
				class PrimaryListbox: SXRscListBox {
					idc = 1000;
					x = 0.02;
					y = 0.02;
					w = (SafeZoneW / 2) - 0.38;
					h = 0.2;
					rowHeight = 0.06;
					sizeEx = 0.034;
					shadow = 0;
					colorBackground[] = {0,0,0,0.1};
					onLBSelChanged = "[_this] call d_fnc_geardialogselchanged";
				};
				
				class MagazineListbox: PrimaryListbox {
					y = 0.25;
				};
				
				// TODO Add magazine listbox for the specific weapon
				// TODO Add attachable items listbox for the specific weapon
				// TODO Add Save or Accept Button
				
				class AcceptButton: XD_ButtonBase2 {
					text = "Save Changes"; 
					action = "";
					x = 0.03;
					y =	0.938198 * safezoneH - 0.06;
					default = false;
				};
			};
		};
		
		class SecondaryControlsGroup: PrimaryControlsGroup {
			idc = 6000;
		};
		
		class HandgunControlsGroup: PrimaryControlsGroup {
			idc = 7000;
		};
		
		/*class BackGroundCaptionLeft: XC_RscText {
			x = SafeZoneXAbs;
			y = SafeZoneY;
			w = (SafeZoneWAbs / 2) - 0.3;
			h = 1 / 25;
			colorBackground[] = __GUI_BCG_RGB;
		};
		class PrimaryCaption: XC_RscText {
			x = SafeZoneX + 0.02; y = SafeZoneY;
			w = 0.4; h = 0.04;
			sizeEx = 0.04;
			colorBackground[] = {1, 1, 1, 0};
			XCTextBI;
			text = "Select Primary Weapon";
		};*/
	};
};